<template>
  <div>
    <el-row :gutter="15">
      <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
        <el-col :span="24">
          <el-input v-model="formData.account" placeholder="请输入账号" clearable :style="{width: '100%'}">
          </el-input>
        </el-col>
        <el-col :span="24">
          <el-input v-model="formData.pwd" placeholder="请输入密码" clearable :style="{width: '100%'}">
          </el-input>
        </el-col>
        <el-col :span="24">
          <el-select v-model="formData.sharedTenantId" placeholder="请选择合租人" filterable clearable :style="{width: '100%'}"></el-select>
        </el-col>
        <el-col :span="9">
          <el-select v-model="formData.regionId" placeholder="请选择大区" clearable :style="{width: '100%'}">
            <el-option v-for="(item, index) in regionIdOptions" :key="index" :label="item.label" :value="item.value"
              :disabled="item.disabled"></el-option>
          </el-select>
        </el-col>
        <el-col :span="8">
          <el-input v-model="formData.segmentInformation" placeholder="段位" clearable :style="{width: '100%'}"></el-input>
        </el-col>
        <el-col :span="8">
          <el-input v-model="formData.price" placeholder="元/时" clearable :style="{width: '100%'}">
          </el-input>
        </el-col>
        <el-col :span="8">
          <el-input v-model="formData.gameName" placeholder="游戏昵称" clearable :style="{width: '100%'}">
          </el-input>
        </el-col>
        <el-col :span="24">
          <el-input v-model="formData.extInfo" type="textarea" placeholder="请输入扩展信息" :autosize="{minRows: 4, maxRows: 4}"
            :style="{width: '100%'}"></el-input>
        </el-col>
        <el-col :span="24">
          <el-form-item size="large">
            <el-button type="primary" @click="submitForm">提交</el-button>
            <el-button @click="resetForm">重置</el-button>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>
  </div>
</template>
<script>
  export default {
    components: {},
    props: [],
    data() {
      return {
        formData: {
          account: undefined,
          pwd: undefined,
          sharedTenantId: undefined,
          regionId: undefined,
          segmentInformation: undefined,
          price: undefined,
          gameName: undefined,
          extInfo: undefined,
        },
        rules: {
          account: [{
            required: true,
            message: '请输入账号',
            trigger: 'blur'
          }],
          pwd: [{
            required: true,
            message: '请输入密码',
            trigger: 'blur'
          }],
          sharedTenantId: [],
          regionId: [{
            required: true,
            message: '请选择大区',
            trigger: 'change'
          }],
          segmentInformation: [{
            required: true,
            message: '段位',
            trigger: 'blur'
          }],
          price: [{
            required: true,
            message: '元/时',
            trigger: 'blur'
          }],
          gameName: [{
            required: true,
            message: '游戏昵称',
            trigger: 'blur'
          }],
          extInfo: [{
            required: true,
            message: '请输入扩展信息',
            trigger: 'blur'
          }],
        },
        regionIdOptions: [{
          "label": "选项一",
          "value": 1
        }, {
          "label": "选项二",
          "value": 2
        }],
      }
    },
    computed: {},
    watch: {},
    created() {},
    mounted() {},
    methods: {
      submitForm() {
        this.$refs['elForm'].validate(valid => {
          if (!valid) return
          // TODO 提交表单
        })
      },
      resetForm() {
        this.$refs['elForm'].resetFields()
      },
    }
  }
</script>
<style>
</style>
